home *** CD-ROM | disk | FTP | other *** search
/ Larry Magid's Essential Internet / Larry Magid's Essential Internet (Quarterdeck Corporation)(1995).ISO / qsockpro.qip / IDNET.MPS < prev    next >
Text File  |  1995-10-09  |  2KB  |  69 lines

  1. # ID-Net Services PPP and SLIP login script
  2. # Copyright 1995 Quarterdeck Corporation
  3. # Authored 5/16/95 Kevin Flick
  4.  
  5. #define the variables we will need
  6.  
  7. STRING username
  8. STRING password
  9. STRING framing
  10. STRING IPAddress
  11.  
  12. # uncomment for debugging
  13. #TRACE ON
  14.  
  15. # reset maximum login timeout.
  16. SetTimeout 90
  17.  
  18. CfgGetValue "Username" username
  19. IF result = 0 THEN
  20.     GetInput "Enter your user name" username
  21.     IF result = 0 THEN
  22.         PRINT "Warning, no username entered"
  23.     ELSE
  24.         PRINT "Username set to ["; username; "]"
  25.     ENDIF
  26. ENDIF
  27.  
  28. # get password from access method
  29. # if the Password field is empty, prompt the user for it.
  30. CfgGetValue "Password" password
  31. IF result = 0 THEN
  32.     GetPassword "Enter your password" password
  33.     IF result = 0 THEN
  34.         PRINT "Warning, no password entered"
  35.     ELSE
  36.         # NOTE: Don't print password.
  37.         PRINT "Password set."
  38.     ENDIF
  39. ENDIF
  40.  
  41. CfgGetValue "Framing" framing
  42. IF result = 0 THEN
  43.     ABORT "Cannot load framing (SLIP or PPP) from qdeck.ini."
  44. ENDIF
  45.  
  46. CommWaitFor "GATEWAY"           # wait for login prompt
  47. #DELAY 5
  48. IF framing = "MPSLIP" THEN
  49.     CommSend "S"
  50. ELSE
  51.     CommSend "P"
  52. ENDIF
  53.     CommSend username           # send user name
  54.     CommSend "%r"               # send carriage return
  55.  
  56. CommWaitFor "assword"           # wait for password prompt
  57. #DELAY 5
  58.     CommSend password           # send password
  59.     CommSend "%r"               # send carriage return
  60.  
  61. CommWaitFor "to "          # wait for ip address
  62. CommReadIPAddr IPAddress
  63. IF result>0 THEN
  64.     CfgSetValue "IPAddress" IPAddress
  65.     PRINT "%rIP Address set to ["; IPAddress; "]"
  66. ENDIF
  67.  
  68. END
  69.